package dd.mm.ee;

import java.util.*;

/**
 * Created by Admin on 12/30 0030.
 */
public class Person {
    private String name="bmj";
    private String age;

    void find() {
        //访问内部类,需要建立对象
        Student student = new Student();
        student.function();
    }

    public class Student {
        //内部类,他也可以有自己的成员变量
        private int id;
        private String classes;

        void function() {
            System.out.println("调取外部类的成员:" + name);
        }

    }

}

class Test {
    public static void main(String[] args) {
//        //在其他的类中调用内部类的方式
//        Person.Student ps = new Person().new Student();
//        ps.function();

        char a='5';
        char b='7';
        int t= (char) ((a-48)+(b-48));
        char l= (char) (a-b);
        char u= (char)(a*b);
        char k= (char)(a/b);
        System.out.println("a: "+a+" b: "+b);
        System.out.println("t: "+t+" l: "+l+" u: "+u+" k: "+k);
        int c=a+b;
        int d=a-b;
        int e=a*b;
        int f=a/b;
        System.out.println("c= "+c+"\n d= "+d+"\n e= "+e+"\n f= "+f);
       //输出结果为: c=103 d=3 e=2650 f=1

        Byte y=3;
        int i=y;
        String s="1234";
        int m= Integer.parseInt(s);
        System.out.println(i);
        System.out.println(m+1);

        String q="1";
        switch (q){
            case "1":
                System.out.println("可以");
                break;
            case "23":
                System.out.println("不可以");
                break;
        }

        String ss="12345";
        int ii=12;
        Integer integer2=Integer.valueOf(ii+1);
        System.out.println(integer2);//13
        Integer integer=Integer.valueOf(ss);
        Integer integer11=integer+1;
        System.out.println(integer11);//12346
        Integer integer3=Integer.valueOf(ss+ii);
        System.out.println(integer3);//1234512
        Integer integer4=Integer.parseInt(ss);
        System.out.println(integer4+1);//12346

        List list=new ArrayList();
        list.add("java01");
        list.add("java02");
        list.add("java03");
        list.add("java04");
        ListIterator li=list.listIterator();
        while(li.hasNext()){
            Object obj=li.next();
            if(obj.equals("java02")) {
                li.set("jjjj");
                li.add("java05");
            }
            System.out.println(obj);
        }
        System.out.println(list);
        // 结果: [java01, jjjj, java05, java03, java04]



        Map map=new HashMap();
        map.put("name","bmj");
        map.put("age","24");
        map.put("address","bj");
        Set<String> set=map.keySet();
        Iterator<String> it=set.iterator();
        while (it.hasNext()){
            String kkk=it.next();
            String vvv= (String) map.get(kkk);
            System.out.println(kkk+"=="+vvv);
        }

        Set<Map.Entry<String,String>> entries=map.entrySet();
        Iterator<Map.Entry <String,String >> it1=entries.iterator();
        while (it1.hasNext()){
            Map.Entry<String,String> mm=it1.next();
           String kk= mm.getKey();
            String vv=mm.getValue();
            System.out.println(kk+"::"+vv);
            //address::bj
            // name::bmj
//            age::24

        }




    }
}